﻿@inject IStringLocalizer<BootstrapBlazor.Shared.Samples.Markdowns> Localizer

<div style="width: 100%; height: 300px;">
    <Markdown Language="@Language" @bind-Value="@MarkdownString" @bind-Html="@HtmlString" />
</div>
<div class="mt-3">
    <textarea class="form-control" rows="6" disabled="disabled">
        @MarkdownString
        </textarea>
</div>
<div class="mt-3">
    <textarea class="form-control" rows="6" disabled="disabled">
        @HtmlString
        </textarea>
</div>

@code {
    private string? MarkdownString { get; set; }

    private string? HtmlString { get; set; }

    private string? Language { get; set; }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    /// <returns></returns>
    protected override void OnInitialized()
    {
        Language = CultureInfo.CurrentUICulture.Name;
        MarkdownString = $"### {Localizer["MarkdownString"]}";
    }
}
